﻿<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
	content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<title>微信绑定</title>
<link rel="stylesheet" href="../assets/css/indexModel.css" />
<link rel="stylesheet" href="../assets/css/regist.css" />
<script src="../assets/js/jquery-1.8.3.min.js"></script>
<script src="../assets/js/regist.js">

    </script>
</head>
<body>
	<div class="main">
		<form class="content">
			<div class="title">
				<a href="menu.html" class="before">＜</a>回收员微信绑定
			</div>
			<div>
				<input type="text" placeholder="移动电话" name="phone" />
			</div>
			<button class="button" id="bind">立即绑定</button>
			<!-- <input type="button" id="bind" value="立即绑定"> -->
		</form>
	</div>
	<div class="shadow">
		<span class="heightCenter"></span>
		<div>
			<label><input checked type="radio" name="name" value="0" />-请选择-</label>
			<label><input type="radio" name="name" value="1" />北京市</label> <label><input
				type="radio" name="name" value="2" />北京市</label> <label><input
				type="radio" name="name" value="3" />北京市</label> <label><input
				type="radio" name="name" value="4" />北京市</label> <label><input
				type="radio" name="name" value="5" />北京市</label>
		</div>
	</div>
	<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
	<script type="text/javascript"> 
$("#bind").on("click", function () {
var tel = /^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\d{8}$/;
if(tel.test($('#telphone').val())){
		 var phone = $("[name=phone]").val();
	    $.ajax({
	        type: "post",
	        url: "/fgd/bind/bindPhone",
	        data: {phone: phone},
	        success: function (data) {
	         	alert(data);
	         	 	window.location.href = "http://b5186ecc.ngrok.io/fgd/order/goOrder";
	        },
	        error: function () {
	         alert("x");
	        }

	    })
	});
}else{
	alert('你输入的手机号格式不正确');
}


</script>
</body>
</html>